package me.ingxin.android.router.base

import android.app.Application
import android.content.Context
import android.content.res.Configuration

/**
 * Created by ingxin on 2022/4/18
 * library component
 */
abstract class BaseComponent {

    /**
     * [Application.attachBaseContext]
     */
    open fun attachBaseContext(application: Application,base: Context?) {

    }

    /**
     * 组件初始化
     * @param application 当前运行的application
     */
    abstract fun onCreate(application: Application)

    /**
     * [Application.onConfigurationChanged]
     */
    open fun onConfigurationChanged(application: Application, newConfig: Configuration) {

    }

    /**
     * [Application.onLowMemory]
     */
    open fun onLowMemory(application: Application) {

    }

    /**
     * [Application.onTrimMemory]
     */
    open fun onTrimMemory(application: Application, level: Int) {

    }

    /**
     * [Application.onTerminate]
     */
    open fun onTerminate() {

    }

}